<!doctype html>
<html lang="zh-cmn-Hans" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
    <body class="layui-layout-body">
        <div th:fragment="menu">
            <div class="layui-header">
                <script type="text/javascript">
                    function updatePassword() {
                        $.ajax({
                            type: "POST",
                            url: "user/update-password",
                            cache: false,
                            timeout: 600000,
                            success: function (data) {
                                layer.open({
                                    /* type: 1, */
                                    title: '修改当前用户密码',
                                    skin: 'layui-layer-rim', //样式类名
                                    anim: 2,
                                    area: ['450px', '550px'], //宽高
                                    shadeClose: false, //开启遮罩关闭
                                    content: data,
                                    btn: '关闭',
                                    yes: function () {
                                        layer.closeAll();
                                    }
                                });
                            },
                            error: function (jqXHR, textStatus, errorThrown) {
                                alert("error");
                                alert(jqXHR.responseText);
                            }
                        });
                    }
                </script>
                <div class="layui-logo">功能管理系统</div>
                <!-- 头部区域（可配合layui已有的水平导航） -->
                <ul class="layui-nav layui-layout-left">
                    <li class="layui-nav-item" shiro:hasPermission="master">
                        <a href="javascript:;">基础数据</a>
                        <dl class="layui-nav-child">
                            <dd shiro:hasPermission="master.config">
                                <a id="config" class="item" th:onclick="'load(\'' + @{/config} + '\',this);'"
                                   target="_blank">系统参数管理
                                </a>
                            </dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item" shiro:hasPermission="tool">
                        <a href="javascript:;">工具</a>
                        <dl class="layui-nav-child">

                            <dd shiro:hasPermission="tool.studyplan">
                                <a id="studyPlan" class="item" th:onclick="'load(\'' + @{/studyPlan} + '\',this);'"
                                   target="_blank">学习规划
                                </a>
                            </dd>

                            <dd shiro:hasPermission="tool.email">
                                <a id="email" class="item" th:onclick="'load(\'' + @{/email} + '\',this);'"
                                   target="_blank">发邮件
                                </a>
                            </dd>
                            <dd shiro:hasPermission="tool.mq">
                                <a id="mqTest" class="item" th:onclick="'load(\'' + @{/mqTest} + '\',this);'"
                                   target="_blank">MQ测试页面
                                </a>
                            </dd>
                            <dd shiro:hasPermission="tool.excel">
                                <a id="excel" class="item" th:onclick="'load(\'' + @{/excel} + '\',this);'"
                                   target="_blank">EXCEL工具
                                </a>
                            </dd>
                            <dd shiro:hasPermission="tool.datamachining">
                                <a id="data_machining" class="item" th:onclick="'load(\'' + @{/dataMachining} + '\',this);'"
                                   target="_blank">数据加工
                                </a>
                            </dd>
                        </dl>
                    </li>

                    <li class="layui-nav-item" shiro:hasPermission="collect">
                        <a href="javascript:;">收藏</a>
                        <dl class="layui-nav-child" shiro:hasPermission="collect.romantic">
                            <dd>
                                <a id="romantic" class="item" th:onclick="'load(\'' + @{/romantic} + '\',this);'"
                                   target="_blank">浪漫动图
                                </a>
                            </dd>
                            <dd>
                                <a id="dynamicText" class="item" th:onclick="'load(\'' + @{/dynamicText} + '\',this);'"
                                   target="_blank">动态文字
                                </a>
                            </dd>
                        </dl>

                    <li class="layui-nav-item" shiro:hasPermission="other">
                        <a href="javascript:;">其他</a>
                        <dl class="layui-nav-child" shiro:hasPermission="other.personmanage">
                            <dd>
                                <a id="personManage" class="item"
                                   th:onclick="'load(\'' + @{/personManage} + '\',this);'" target="_blank">人员信息管理页面
                                </a>
                            </dd>
                        </dl>


                    </li>
                    <li class="layui-nav-item" shiro:hasRole="admin">
                        <a href="javascript:;">用户权限管理</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a id="userManage" class="item" th:onclick="'load(\'' + @{/user} + '\',this);'"
                                   target="_blank">用户管理页面
                                </a>
                            </dd>
                            <dd>
                                <a id="roleManage" class="item" th:onclick="'load(\'' + @{/role} + '\',this);'"
                                   target="_blank">角色管理页面
                                </a>
                            </dd>
                        </dl>
                    </li>
                </ul>
                <ul class="layui-nav layui-layout-right">
                    <li class="layui-nav-item">
                        <a href="javascript:;">
                            <shiro:user>欢迎 :
                                <shiro:principal property="displayName"/>
                            </shiro:user>
                        </a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a class="item" onclick="updatePassword()">更改密码</a>
                            </dd>
                            <dd>
                                <a href="">安全设置</a>
                            </dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a th:href="@{/logout}">退出</a>
                    </li>
                </ul>
            </div>

            <div class="layui-side layui-bg-black">
                <div class="layui-side-scroll">
                    <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                    <ul class="layui-nav layui-nav-tree" lay-filter="test">
                        <li class="layui-nav-item layui-nav-itemed">
                            <a class="" href="javascript:;">导航页</a>
                            <dl class="layui-nav-child">
                                <dd shiro:hasPermission="tool.url">
                                    <a id="urlManage" class="item" th:onclick="'load(\'' + @{/url} + '\',this);'"
                                       target="_blank">总导航页
                                    </a>
                                </dd>
                                <dd shiro:hasPermission="tool.usualurl">
                                    <a id="usualUrlManage" class="item"
                                       th:onclick="'load(\'' + @{/usualUrl} + '\',this);'" target="_blank">常用导航
                                    </a>
                                </dd>
                                <dd shiro:hasPermission="tool.urledit">
                                    <a id="urlEdit" class="item" th:onclick="'load(\'' + @{/urlEdit} + '\',this);'"
                                       target="_blank">导航编辑
                                    </a>
                                </dd>
                            </dl>
                        </li>
                    </ul>
                </div>
            </div>
            <script>
                //JavaScript代码区域
                layui.use('element', function () {
                    var element = layui.element;
                });
            </script>
        </div>
    </body>
</html>
